package com.xuecheng.search.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;

/**
 * @author 勾新杰
 * @version 1.0
 * @description: elasticsearch配置属性
 * @date 2025/2/19 20:04
 */
@Data
@Component
@ConfigurationProperties(prefix = "elasticsearch")
public class ElasticsearchProperties {

    /**
     * es集群地址，节点之间用,分隔
     */
    private String hostList;

    /**
     * course索引配置
     */
    @NestedConfigurationProperty
    private Course course;

    @Data
    public static class Course {

        /**
         * 索引名称
         */
        private String indexName;

        /**
         * 索引字段，字段之间用,分隔
         */
        private String sourceFields;
    }
}
